
<%@ page import="com.pyrsana.faith.membership.Profile" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'profile.label', default: 'Profile')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<div class="content" role="main">
			<h1><g:message code="default.show.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list profile">
			
				<li class="fieldcontain">
					<span id="first-label" class="property-label"><g:message code="profile.first.label" default="First" /></span>
					<span class="property-value" aria-labelledby="first-label"><g:fieldValue bean="${profileInstance}" field="first"/></span>
				</li>
			
				<li class="fieldcontain">
					<span id="last-label" class="property-label"><g:message code="profile.last.label" default="Last" /></span>
					<span class="property-value" aria-labelledby="last-label"><g:fieldValue bean="${profileInstance}" field="last"/></span>
				</li>
			
				<g:if test="${profileInstance?.middle}">
					<li class="fieldcontain">
						<span id="middle-label" class="property-label"><g:message code="profile.middle.label" default="Middle" /></span>
						<span class="property-value" aria-labelledby="middle-label"><g:fieldValue bean="${profileInstance}" field="middle"/></span>
					</li>
				</g:if>
			
				<li class="fieldcontain">
					<span id="gender-label" class="property-label"><g:message code="profile.gender.label" default="Gender" /></span>
					<span class="property-value" aria-labelledby="gender-label"><g:fieldValue bean="${profileInstance}" field="gender"/></span>					
				</li>
			
				<li class="fieldcontain">
					<span id="birthday-label" class="property-label"><g:message code="profile.birthday.label" default="Birthday" /></span>
					<span class="property-value" aria-labelledby="birthday-label"><putils:formatDate date="${profileInstance?.birthday}" /></span>
				</li>
			
				<g:if test="${profileInstance?.emailAddresses}">
					<li class="fieldcontain">
						<span id="emailAddresses-label" class="property-label"><g:message code="profile.emailAddresses.label" default="Email Address" /></span>
						<g:each in="${profileInstance.emailAddresses}" var="e">
							<span class="property-value" aria-labelledby="emailAddresses-label">${e?.encodeAsHTML()}</span>
						</g:each>
					</li>
				</g:if>
				
				<g:if test="${profileInstance?.phoneNumbers}">
					<li class="fieldcontain">
						<span id="phoneNumbers-label" class="property-label"><g:message code="profile.phoneNumbers.label" default="Phone Number" /></span>
						<g:each in="${profileInstance.phoneNumbers}" var="p">
							<span class="property-value" aria-labelledby="phoneNumbers-label">${p?.encodeAsHTML()}</span>
						</g:each>
					</li>
				</g:if>
				
				<g:if test="${profileInstance?.addresses}">
					<li class="fieldcontain">
						<span id="addresses-label" class="property-label"><g:message code="profile.addresses.label" default="Address" /></span>
						<g:each in="${profileInstance.addresses}" var="a">
							<span class="property-value" aria-labelledby="addresses-label">${a?.encodeAsHTML()}</span>
						</g:each>
					</li>
				</g:if>
			
				<li class="fieldcontain">
					<span id="dateCreated-label" class="property-label"><g:message code="profile.dateCreated.label" default="Date Created" /></span>
					<span class="property-value" aria-labelledby="dateCreated-label"><putils:formatDate date="${profileInstance?.dateCreated}" /></span>
				</li>
			
				<li class="fieldcontain">
					<span id="lastUpdated-label" class="property-label"><g:message code="profile.lastUpdated.label" default="Last Updated" /></span>
					<span class="property-value" aria-labelledby="lastUpdated-label"><putils:formatDate date="${profileInstance?.lastUpdated}" /></span>
				</li>
			</ol>
			<g:form>
				<fieldset class="buttons center">
					<g:hiddenField name="id" value="${profileInstance?.id}" />
					<g:link class="edit" action="edit" id="${profileInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
					<%--
						// Delete currently incomplete. Would leave orphan records in database.
						<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
					 --%>
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
